<?php
// +----------------------------------------------------------------------
// | ThinkPHP [ WE CAN DO IT JUST THINK ]
// +----------------------------------------------------------------------
// | Copyright (c) 2006-2016 http://thinkphp.cn All rights reserved.
// +----------------------------------------------------------------------
// | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
// +----------------------------------------------------------------------
// | Author: 流年 <liu21st@gmail.com>
// +----------------------------------------------------------------------

// 应用公共文件

function ajaxReturn($msg='',$status='',$data='')
{
    $data =array('msg'=>$msg,'status'=>$status,'data'=>$data);
    return die(json_encode($data));
}

//清除markdown
function clear_md($content)
{
    return str_replace(['#','/','-','@','`','$','\\'],'',strip_tags( mb_substr($content, 0, 400, 'utf-8')));
}

//判断目录是否存在 不存在创建目录
function md($path){
   if(!file_exists ( $path ))  mkdir( $path , 0777,true);
}
